public class demo8 {
    public volatile static int count = 0;
    public static void main(String[] args) throws InterruptedException {
        Object object = new Object();
        Thread t = new Thread(()->{
            for (int i = 0; i < 50000; i++) {
                count++;
            }
        });
        Thread t1 = new Thread(()->{
            for (int i = 0; i < 50000; i++) {
                count++;
            }
        });
        t.start();
        t1.start();
        t.join();
        t1.join();
        System.out.println(count);
    }
}